gtk4-demo: Fix the scrollbar popup menu example
authorMatthias Clasen <mclasen@redhat.com>
Sat, 7 Oct 2017 23:54:47 +0000 (19:54 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 7 Oct 2017 23:54:47 +0000 (19:54 -0400)
A scrollbar is not a range anymore, so the callback
needs some adjustments (!).

demos/gtk-demo/main.c

index 820f1dbd391aa758d19beba8a158471403131cbf..d0cca8c8f056a2df69d8f0793458c6dd9768aaa5 100644 (file)
@@ -958,7 +958,7 @@ start_cb (GtkMenuItem *item, GtkWidget *scrollbar)
 {
   GtkAdjustment *adj;
 
-  adj = gtk_range_get_adjustment (GTK_RANGE (scrollbar));
+  adj = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (scrollbar));
   gtk_adjustment_set_value (adj, gtk_adjustment_get_lower (adj));
 }
 
@@ -967,7 +967,7 @@ end_cb (GtkMenuItem *item, GtkWidget *scrollbar)
 {
   GtkAdjustment *adj;
 
-  adj = gtk_range_get_adjustment (GTK_RANGE (scrollbar));
+  adj = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (scrollbar));
   gtk_adjustment_set_value (adj, gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj));
 }